#include "CTimer.h"

using namespace GameCore;
CTimer* CTimer::pInstance = NULL;

CTimer::CTimer()
{
	lastTime = GetTickCount();

}

CTimer* CTimer::getInstance()
{
	if (pInstance == NULL)
	{
		pInstance = new CTimer();
	}
	return pInstance;

}

void CTimer::update()
{
	lastTime = GetTickCount();
}

float CTimer::getElapsedTime()
{
	float time = GetTickCount();
	float r = time - lastTime;
	lastTime = time;
	return r;
}